home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Files / XTND 1.3.6 / Application Examples / CSource / TESample.r < prev    next >
Encoding:
Text File  |  1992-01-17  |  7.4 KB  |  363 lines  |  [TEXT/MPS ]

  1. /************************************************************************
  2. *                                                                        *
  3. *    TESample.r                                                            *
  4. *                                                                        *
  5. *    This file contains the resources to be included in the TESample        *
  6. *    application.                                                        *
  7. *                                                                        *
  8. *    Copyright © 1988 Claris Corporation                                    *
  9. *    All Rights Reserved                                                    *
  10. *                                                                        *
  11. ************************************************************************/
  12.  
  13. #ifndef __TE_Sample_Res__
  14. #define __TE_Sample_Res__
  15.  
  16. #include "systypes.r"
  17. #include "types.r"
  18.  
  19. #include "TESample.h"        /* Contains necessary defines used in this file */
  20.  
  21.  
  22. resource 'STR#' (25002, "PopUp Menu Names", purgeable) {
  23.     {    /* array StringArray: 3 elements */
  24.         /* [1] */
  25.         "TESample",
  26.         /* [2] */
  27.         "TESample Stationery",
  28.         /* [3] */
  29.         "Text"
  30.     }
  31. };
  32.  
  33. resource 'STR#' (25003, "Claris ƒ names", purgeable) {
  34.     {    /* array StringArray: 1 elements */
  35.         /* [1] */
  36.         "Claris"
  37.     }
  38. };
  39.  
  40. resource 'STR#' (25004, "Claris XTND names", purgeable) {
  41.     {    /* array StringArray: 2 elements */
  42.         /* [1] */
  43.         "Claris Translators",
  44.         /* [2] */
  45.         "Claris XTND System"
  46.     }
  47. };
  48.  
  49.  
  50. resource 'vers' (1) {
  51.     0x02, 0x00, release, 0x00, verUS,
  52.     "2.00",
  53. #ifdef qFINAL
  54.     "2.00, Copyright © 1989-1991 Apple Computer, Inc."
  55. #else
  56.     $$Shell("VERS_TAG")
  57. #endif qFINAL
  58. };
  59.  
  60. /* we use an MBAR resource to conveniently load all the menus */
  61.  
  62. resource 'MBAR' (rMenuBar, preload) {
  63.     { mApple, mFile, mEdit, mFont, mSize };        /* five menus */
  64. };
  65.  
  66.  
  67. resource 'MENU' (mApple, preload) {
  68.     mApple, textMenuProc,
  69.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  70.     enabled, apple,
  71.     {
  72.         "About TESample\311",
  73.             noicon, nokey, nomark, plain;
  74.         "-",
  75.             noicon, nokey, nomark, plain
  76.     }
  77. };
  78.  
  79. resource 'MENU' (mFile, preload) {
  80.     mFile, textMenuProc,
  81.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  82.     enabled, "File",
  83.     {
  84.         "New",
  85.             noicon, "N", nomark, plain;
  86.         "Open",
  87.             noicon, "O", nomark, plain;
  88.         "-",
  89.             noicon, nokey, nomark, plain;
  90.         "Close",
  91.             noicon, "W", nomark, plain;
  92.         "Save",
  93.             noicon, "S", nomark, plain;
  94.         "Save As\311",
  95.             noicon, nokey, nomark, plain;
  96.         "Revert",
  97.             noicon, nokey, nomark, plain;
  98.         "-",
  99.             noicon, nokey, nomark, plain;
  100.         "Page Setup\311",
  101.             noicon, nokey, nomark, plain;
  102.         "Print\311",
  103.             noicon, nokey, nomark, plain;
  104.         "-",
  105.             noicon, nokey, nomark, plain;
  106.         "Quit",
  107.             noicon, "Q", nomark, plain
  108.     }
  109. };
  110.  
  111. resource 'MENU' (mEdit, preload) {
  112.     mEdit, textMenuProc,
  113.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  114.     enabled, "Edit",
  115.      {
  116.         "Undo",
  117.             noicon, "Z", nomark, plain;
  118.         "-",
  119.             noicon, nokey, nomark, plain;
  120.         "Cut",
  121.             noicon, "X", nomark, plain;
  122.         "Copy",
  123.             noicon, "C", nomark, plain;
  124.         "Paste",
  125.             noicon, "V", nomark, plain;
  126.         "Clear",
  127.             noicon, nokey, nomark, plain
  128.     }
  129. };
  130.  
  131. resource 'MENU' (mFont, preload) {
  132.     mFont, textMenuProc,
  133.     0,    /*  */
  134.     disabled, "Font",
  135.     {
  136.     }
  137. };
  138.  
  139. resource 'MENU' (mSize, preload) {
  140.     mSize, textMenuProc,
  141.     0,    /*  */
  142.     disabled, "Size",
  143.     {
  144.         "PointSize",
  145.             noicon, nokey, nomark, plain;
  146.         "0",
  147.             noicon, nokey, nomark, plain
  148.     }
  149. };
  150.  
  151. /* this ALRT and DITL are used as an About screen */
  152.  
  153. resource 'ALRT' (rAboutAlert, purgeable) {
  154.     {40, 20, 198, 320}, rAboutAlert, {
  155.         OK, visible, silent;
  156.         OK, visible, silent;
  157.         OK, visible, silent;
  158.         OK, visible, silent
  159.     };
  160. };
  161.  
  162. resource 'DITL' (rAboutAlert, purgeable) {
  163.     { /* array DITLarray: 5 elements */
  164.         /* [1] */
  165.         {130, 109, 150, 189},
  166.         Button {
  167.             enabled,
  168.             "Thanks!"
  169.         },
  170.         /* [2] */
  171.         {8, 10, 25, 322},
  172.         StaticText {
  173.             disabled,
  174.             "XTND-Capable Styled TextEdit Application"
  175.         },
  176.         /* [3] */
  177.         {29, 10, 63, 311},
  178.         StaticText {
  179.             disabled,
  180.             "Copyright © 1989-1991 Apple Computer\n"
  181.             "& Claris Corporation"
  182.         },
  183.         /* [4] */
  184.         {70, 10, 86, 138},
  185.         StaticText {
  186.             disabled,
  187.             "Brought to you by:"
  188.         },
  189.         /* [5] */
  190.         {89, 10, 123, 281},
  191.         StaticText {
  192.             disabled,
  193.             "Macintosh Developer Technical Support\n"
  194.             "& Claris Corporation"
  195.         }
  196.     }
  197. };
  198.  
  199.  
  200. /* this ALRT and DITL are used as an error screen */
  201.  
  202. resource 'ALRT' (rUserAlert, purgeable) {
  203.     {40, 20, 150, 260},
  204.     rUserAlert,
  205.     { /* array: 4 elements */
  206.         /* [1] */
  207.         OK, visible, silent,
  208.         /* [2] */
  209.         OK, visible, silent,
  210.         /* [3] */
  211.         OK, visible, silent,
  212.         /* [4] */
  213.         OK, visible, silent
  214.     }
  215. };
  216.  
  217.  
  218. resource 'DITL' (rUserAlert, purgeable) {
  219.     { /* array DITLarray: 3 elements */
  220.         /* [1] */
  221.         {85, 86, 105, 166},
  222.         Button {
  223.             enabled,
  224.             "Sorry"
  225.         },
  226.         /* [2] */
  227.         {10, 60, 75, 228},
  228.         StaticText {
  229.             disabled,
  230.             "Error. ^0.\n^1"
  231.         },
  232.         /* [3] */
  233.         {8, 8, 40, 40},
  234.         Icon {
  235.             disabled,
  236.             2
  237.         }
  238.     }
  239. };
  240.  
  241.  
  242. resource 'WIND' (rDocWindow, preload, purgeable) {
  243.     {64, 60, 314, 460},
  244.     zoomDocProc, invisible, goAway, 0x0, "Untitled"
  245. };
  246.  
  247.  
  248. resource 'CNTL' (rVScroll, preload, purgeable) {
  249.     {-1, 385, 236, 401},
  250.     0, visible, 0, 0, scrollBarProc, 0, ""
  251. };
  252.  
  253.  
  254. resource 'CNTL' (rHScroll, preload, purgeable) {
  255.     {235, -1, 251, 386},
  256.     0, visible, 0, 0, scrollBarProc, 0, ""
  257. };
  258.  
  259. resource 'STR#' (kErrStrings, purgeable) {
  260.     {
  261.     "You must run on 512Ke or later";
  262.     "Application Memory Size is too small";
  263.     "Not enough memory to run TESample";
  264.     "Not enough memory to do Cut";
  265.     "Cannot do Cut";
  266.     "Cannot do Copy";
  267.     "Cannot exceed 32,000 characters with Paste";
  268.     "Not enough memory to do Paste";
  269.     "Cannot create window";
  270.     "Cannot exceed 32,000 characters";
  271.     "Cannot do Paste";
  272.     "Could not open the correct translator";
  273.     "Could not read in the correct translator";
  274.     "Error opening resource fork of document";
  275.     "Error reading resources from document";
  276.     "Error opening document";
  277.     "Error initializing translator";
  278.     "Error deleting previous file";
  279.     "Could not create file";
  280.     "Error opening file"
  281.     }
  282. };
  283.  
  284. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  285.  
  286. resource 'SIZE' (-1) {
  287.     dontSaveScreen,
  288.     acceptSuspendResumeEvents,
  289.     enableOptionSwitch,
  290.     canBackground,                /* we can background; we don't currently, but our sleep value */
  291.                                 /* guarantees we don't hog the Mac while we are in the background */
  292.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  293.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  294.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  295.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  296.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  297.     reserved,
  298.     reserved,
  299.     reserved,
  300.     reserved,
  301.     reserved,
  302.     reserved,
  303.     reserved,
  304.     kPrefSize * 1024,
  305.     kMinSize * 1024
  306. };
  307.  
  308.  
  309. type 'XTND' as 'STR ';
  310.  
  311.  
  312. resource 'XTND' (0) {
  313.     "XTND-Capable Styled TextEdit Application"
  314. };
  315.  
  316.  
  317. resource 'BNDL' (128) {
  318.     'XTND',
  319.     0,
  320.     {
  321.         'ICN#',
  322.         {
  323.             0, 128
  324.         },
  325.         'FREF',
  326.         {
  327.             0, 128
  328.         }
  329.     }
  330. };
  331.  
  332.  
  333. resource 'FREF' (128) {
  334.     'APPL',
  335.     0,
  336.     ""
  337. };
  338.  
  339.  
  340. resource 'ICN#' (128) {
  341.     {    /* array: 2 elements */
  342.         /* [1] */
  343.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  344.         $"1224 0405 2028 7FF9 4010 2011 8000 1011"
  345.         $"8802 2012 7405 4014 0208 8814 0410 4418"
  346.         $"0820 2214 1044 1052 1882 08B1 0D11 1112"
  347.         $"0A08 2204 0844 4408 0820 8810 0811 1020"
  348.         $"0802 A040 0804 4080 0808 0100 0804 0200"
  349.         $"0FFE 0400 0002 0800 0001 1000 0000 A000"
  350.         $"0000 40",
  351.         /* [2] */
  352.         $"0430 4000 0E70 E000 0FF1 F002 0FE3 F803"
  353.         $"1FE7 FC07 3FEF FFFF 7FFF FFFF FFFF FFFF"
  354.         $"FFFF FFFE 7FFF FFFC 01FF FFFC 03FF FFF8"
  355.         $"07FF FFFC 0FFF FFFE 1FFF FFFF 0FFF FFFE"
  356.         $"0FFF FFFC 0FFF FFF8 0FFF FFF0 0FFF FFE0"
  357.         $"0FFF FFC0 0FFF FF80 0FFF FF00 0FFF FE00"
  358.         $"0FFF FC00 0003 F800 0001 F000 0000 E000"
  359.         $"0000 40"
  360.     }
  361. };
  362.  
  363. #endif